package com.gnerv.sylvanas.business.manage.storage;

import com.gnerv.sylvanas.business.manage.model.dto.ConfigDTO;
import com.gnerv.sylvanas.business.manage.model.entity.Config;
import com.gnerv.sylvanas.business.manage.repository.mapper.ConfigMapper;
import lombok.AllArgsConstructor;
import lombok.NonNull;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Gnerv LiGen
 */
@Service
@AllArgsConstructor
public class ConfigStorageService {

    private final ConfigMapper configMapper;

    
    public int insert(@NonNull Config config) {
        return configMapper.insert(config);
    }

    
    public int deleteByUkId(@NonNull String ukId) {
        return configMapper.deleteByUkId(ukId);
    }

    
    public int updateByUkId(@NonNull Config config) {
        return configMapper.updateByUkId(config);
    }

    
    public ConfigDTO selectByUkId(@NonNull String ukId) {
        return configMapper.selectByUkId(ukId);
    }

    
    public List<ConfigDTO> selectListByName(String name) {
        return configMapper.selectListByName(name);
    }
}
